<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>DOMDEM加载</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>
    <div id="mapContainer" style="position: relative;"></div>
</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    window.app = new GE.App('mapContainer', {
        position: [119.5503034398738, 29.34501850151658, 600],
        lookAt: [119.55097987498354, 29.347578514254775, 10],
        
        // position: [87.608568, 43.801944, 600],
        // lookAt: [87.608568, 43.801944, 10],
        cameraScrollSpeed: 5,
        minZoom: 3,
        maxZoom: 18,
        ambientLightIntensity: 5,
        useDefaultTexture: true, //是否使用瓦片默认纹理       
        useCarpet: true, //开启地图的地毯功能
        maxSlopeAngle: 60, //地图最大倾斜角度
        baseLayer: [
            {
                //  url: 'http://192.168.88.10:49999/t/HMapServer/rest/wmts/zjlx/{z}/{x}/{y}.png',
                url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
                urlDecimal: true,
                // demUrl:'http://192.168.88.10:49999/t/tile-server/szxc/zjlx/DEM/lerc/zjlanxi-ky/_alllayers/{z}/{y}/{x}.lerc',
                demUrl: 'http://localhost:9009/examples/resources/dem/zjlx/DEM/lerc/zjlanxi-ky/_alllayers/{z}/{y}/{x}.lerc',
                //C:\workspace\webglengin\examples\resources\dem\222\222\_alllayers
                // demUrl: 'http://localhost:9009/examples/resources/dem/222/222/_alllayers/{z}/{y}/{x}.lerc',
                demUrlDecimal: false,
                demHeightAdjust:0, 
                // tileType: 'image',
                tileType: 'dem',
                name: 'demLayer', //图层的名字
                canNotSelect: false, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            },
        ]
    });

   
    let model;
    function fbx() {
        let tileMap = app.map.getTileMap('dem', 'demLayer');

        model = new GE.OverLay({
            type: 'fbx',
            falldownSurface: tileMap, //模型要贴到的底图上，可以是3dtiles，也可以是其他的底图(比如dem)
            // url: 'http://localhost:9000/examples/resources/fbx/xqazm.fbx',
            // url: 'http://localhost:9000/examples/resources/fbx/ceshi1.FBX',
            // url: 'http://localhost:9000/examples/resources/fbx/ceshi1.FBX',
            url: 'http://localhost:9000/examples/resources/fbx/sxt.fbx',
            position: [119.55134338194021, 29.357293998912905, 0],
            changeEmissive: false,
            canNotSelect: true, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            scale: [0.5, 0.5, 0.5],
            // rotation: [45, 0, 0],
            success: function () {
                window.app.fireEvent('ThreeTileLoaded');

            }
        })
        model.renderOrder = 100;
        window.app.add(model);
    }
    // fbx();


    window.app.on('Click', function (e) {
        console.log(e);
    });


</script>

</html>